package com.afs.electronicforensics.utils;

import java.io.IOException;

import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;

public class SendCode {

    MediaType JSON = MediaType.parse("application/json;charset=utf-8");
    OkHttpClient client = new OkHttpClient();

    public String post(String url,String json) throws IOException{
        RequestBody body = RequestBody.create(JSON,json);
        Request request = new Request.Builder()
                .url(url)
                .post(body)
                .build();
        try(Response response = client.newCall(request).execute()){
            return response.body().string();
        }
    }
    public String bowlingJson(String checkCode,String phoneNo){
        return "{'sid':'cdf75f03f71eafa3c992dd07e1dc6df6'," +
                " 'token':'1c6e4496ac4b5a2fd7f1148dbdd4cf87'," +
                " 'appid':'5058275f989b404186adf65ad75ff99e'," +
                " 'templateid':'600405'," +
                " 'param':'"+checkCode+",90'," +
                " 'mobile':'"+phoneNo+"'," +
                " 'uid':''}";
    }
}